import { AxiosPromise } from 'axios';
import request from '@/utils/request';
import { StoreCategoryResp } from '../typescript/StoreCategory';


// 商品分类
export function category(query : any) {
    return request({
        url: '/app/category/list',
        method: 'get'
    });
}



// 根据主键查询表的数据
export function getByIdApi(id: any):AxiosPromise<StoreCategoryResp>  {
    return request({
        url: '/app/category/' + id,
        method: 'get',
    });
}


// 新增
export function addApi(data: any) {
    return request({
        url: '/app/category',
        method: 'post',
        data: data,
    });
}

// 修改
export function updateApi(data: any) {
    return request({
        url: '/app/category',
        method: 'put',
        data: data,
    });
}

// 删除岗位
export function delApi(id: any) {
    return request({
        url: '/app/category' + id,
        method: 'delete',
    });
}
